package io.github.shang11925.shangweb2.day240908;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;

@WebServlet("/request-demo1-servlet")
public class RequestDemo1Servlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.getWriter().write(req.getMethod());
        resp.getWriter().write(req.getServletPath());
        resp.getWriter().write(String.valueOf(req.getRequestURL()));
        resp.getWriter().write(req.getRequestURI());
        resp.getWriter().write(req.getQueryString());
    }
}
